import 'package:flutter_test/flutter_test.dart';
import 'package:platform_service/platform_service.dart';
import 'package:platform_service/src/platform_service_method_channel.dart';
import 'package:platform_service/src/platform_service_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPlatformServicePlatform
    with MockPlatformInterfaceMixin
    implements PlatformServicePlatform {
  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<NDFilePickerResult> pickFile() {
    // TODO: implement pickFile
    throw UnimplementedError();
  }

  @override
  Future<List<NDFileInfo>> pickImages(
      {int maxCount = 8,
      bool enableCamera = false,
      bool isWaterMark = false,
      bool isWaterMarkTiled = false,
      List<ImageWaterMarkSettingModel>? waterMarkSettings}) {
    // TODO: implement pickImages
    throw UnimplementedError();
  }

  @override
  Future<NDFileInfo?> takePicture(
      {bool isWaterMark = false,
      bool isWaterMarkTiled = false,
      List<ImageWaterMarkSettingModel>? waterMarkSettings}) {
    // TODO: implement takePicture
    throw UnimplementedError();
  }
}

void main() {
  final PlatformServicePlatform initialPlatform =
      PlatformServicePlatform.instance;

  test('$MethodChannelPlatformService is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPlatformService>());
  });

  test('getPlatformVersion', () async {
    MockPlatformServicePlatform fakePlatform = MockPlatformServicePlatform();
    PlatformServicePlatform.instance = fakePlatform;

    expect(await PlatformService.getPlatformVersion(), '42');
  });
}
